package net.shopxx.dao.impl;

import java.util.ArrayList;
import java.util.List;

import net.shopxx.dao.FlagshipStoreDao;
import net.shopxx.entity.FlagshipStore;

import org.springframework.stereotype.Repository;
import org.apache.commons.lang.StringUtils;

/**
 * Dao实现类 - 旗舰店
 */

@Repository
public class FlagshipStoreDaoImpl extends BaseDaoImpl<FlagshipStore, String>
		implements FlagshipStoreDao {

	@SuppressWarnings("unchecked")
	public List<String> getFlagshipStoreList(int maxResults) {
		String hql = "from FlagshipStore flagshipStore ";
		List<FlagshipStore> retTemp = getSession().createQuery(hql)
				.setMaxResults(maxResults).list();
		List<String> ret = new ArrayList<String>();
		for (FlagshipStore flagshipStore : retTemp) {
			if (StringUtils.isNotEmpty(flagshipStore.getStore_banner())) {
				ret.add(flagshipStore.getStore_banner());
			}
		}
		return ret;
	}

}